package com.yc.jpyy.mobile.controller;


import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yc.jpyy.base.bean.RestResponse;
import com.yc.jpyy.base.controller.BaseController;
import com.yc.jpyy.mobile.service.PayService;

@Controller
@RequestMapping(value = "/pay")
public class PayController extends BaseController {

	private static Logger logger = LoggerFactory.getLogger(PayController.class);

	@Autowired
	private PayService payService;

//	@Autowired
//	private BizDao bizDao;


	/**
	 * 学院端获取缴费历史
	 */
	@RequestMapping(value = "/GetStudyRecharge", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
	public @ResponseBody String GetStudyRecharge(HttpServletRequest request){
		logger.info("=================begin 获取缴费历史=======================");
		RestResponse response = new RestResponse();
		try {
			payService.GetStudyRecharge(getParamMap(request), response);
			
		} catch (Exception e) {
			errorHandler(e, response, logger);
		}finally{
			logger.info("===============end 获取缴费历史=======================");
		}
		return response.toJSON();

	}

	
	
	/**
	 * 学员端获取学时进度详情信息
	 */
	@RequestMapping(value = "/GetCostStudyTime", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
	public @ResponseBody String GetCostStudyTime(HttpServletRequest request){
		logger.info("=================begin 消费记录=======================");
		RestResponse response = new RestResponse();
		try {
			payService.GetCostStudyTime(getParamMap(request), response);
			
		} catch (Exception e) {
			errorHandler(e, response, logger);
		}finally{
			logger.info("===============end 消费记录=======================");
		}
		return response.toJSON();

	}

	
	
	
	
	
	
}
